{template 'common/header-base'}
<div class="system-login" {if !empty($_W['setting']['copyright']['background_img'])} style="background-image:url('{php echo tomedia($_W['setting']['copyright']['background_img']);}')" {else} style="background-image: url('./resource/images/bg-login.png');" {/if}>

	<div class="head">
		<a href="/" class="logo-version">
			<img src="{if !empty($_W['setting']['copyright']['blogo'])}{php echo tomedia($_W['setting']['copyright']['blogo'])}{else}./resource/images/logo/logo.png{/if}" class="logo">
			<span class="version hidden">{IMS_VERSION}</span>
		</a>
		{if !empty($_W['setting']['copyright']['showhomepage'])}
		<a href="{php echo url('account/welcome')}" class="pull-right">首页</a>
		{/if}
	</div>
	<div class="login-panel">
		<div class="title">
			<a href="{php echo url('user/login', array('login_type' => 'system'))}" {if empty($_GPC['login_type']) || $_GPC['login_type'] == 'system'}class="active" {/if}>账号密码</a>
			{if !empty($_W['setting']['copyright']['mobile_status'])}
			<a href="{php echo url('user/login', array('login_type' => 'mobile'))}" {if $_GPC['login_type'] == 'mobile'}class="active" {/if}>手机</a>
			{/if}
		</div>
		<form action="" method="post" role="form" id="form1" onsubmit="return formcheck();" class="we7-form">
			{if empty($_GPC['login_type']) || $_GPC['login_type'] == 'system'}
			<div class="input-group-vertical">
				<input name="login_type" type="hidden" class="form-control " value="system">
				<input name="username" type="text" class="form-control " placeholder="请输入用户名登录">
				<input name="password" type="password" class="form-control password" placeholder="请输入登录密码">
				{if !empty($_W['setting']['copyright']['verifycode'])}
				<div class="input-group">
					<input name="verify" type="text" class="form-control" placeholder="请输入验证码">
					<a href="javascript:;" id="toggle" class="input-group-btn imgverify"><img id="imgverify" src="{php echo url('utility/code')}" title="点击图片更换验证码" /></a>
				</div>
				{/if}
			</div>
			{/if}
			{if $_GPC['login_type'] == 'mobile'}
			<div class="input-group-vertical">
				<input name="login_type" type="hidden" class="form-control " value="mobile">
				<input name="username" type="text" class="form-control " placeholder="请输入手机号登录">
				<input name="password" type="password" class="form-control password" placeholder="请输入登录密码">
				{if !empty($_W['setting']['copyright']['verifycode'])}
				<div class="input-group">
					<input name="verify" type="text" class="form-control" placeholder="请输入验证码">
					<a href="javascript:;" id="toggle" class="input-group-btn imgverify"><img id="imgverify" src="{php echo url('utility/code')}" title="点击图片更换验证码" /></a>
				</div>
				{/if}
			</div>
			{/if}
			<div class="form-inline" style="margin-bottom: 15px;">
				<div class="pull-right">
					<a href="{url 'user/find-password'}" target="_blank" class="color-default">忘记密码？</a>
				</div>
				<div class="checkbox">
					<input type="checkbox" value="true" id="rember" name="rember">
					<label for="rember">记住用户名</label>
				</div>
			</div>
			<div class="login-submit text-center">
				<input type="submit" id="submit" name="submit" value="登录" class="btn btn-primary btn-block" />
				<div class="text-right">
					{if !$_W['siteclose'] && $setting['register']['open']}
						{if empty($_GPC['login_type']) || $_GPC['login_type'] == 'system'}
						<a href="{url 'user/register'}" class="color-default">立即注册</a>
						{/if}
						{if $_GPC['login_type'] == 'mobile'}
						<a href="{php echo url('user/register', array('register_type' => 'mobile'))}" class="color-default">立即注册</a>
						{/if}
					{/if}
				</div>
				<input name="token" value="{$_W['token']}" type="hidden" />
			</div>
			{if !empty($setting['thirdlogin']['qq']['authstate']) || !empty($setting['thirdlogin']['wechat']['authstate'])}
			<div class="text-center">
				<span class="color-gray">使用第三方账号登录</span>
				<div class="form-control-static">
					{if !empty($setting['thirdlogin']['qq']['authstate'])}<a href="{$login_urls['qq']}"><img src="./resource/images/qqlogin.png" width="35px"></a>&nbsp;&nbsp;{/if}
					{if !empty($setting['thirdlogin']['wechat']['authstate'])}<a href="{$login_urls['wechat']}"><img src="./resource/images/wxlogin.png" width="35px"></a>{/if}
				</div>
			</div>
			{/if}
		</form>
	</div>
</div>
{template 'common/footer-base'}
<script>
function formcheck() {
	if($('#remember:checked').length == 1) {
		cookie.set('remember-username', $(':text[name="username"]').val());
	} else {
		cookie.del('remember-username');
	}
	return true;
}
var h = document.documentElement.clientHeight;
$(".system-login").css('height',h);
$('#toggle').click(function() {
	$('#imgverify').prop('src', '{php echo url('utility/code')}r='+Math.round(new Date().getTime()));
	return false;
});
{if !empty($_W['setting']['copyright']['verifycode'])}
	$('#form1').submit(function() {
		var verify = $(':text[name="verify"]').val();
		if (verify == '') {
			alert('请填写验证码');
			return false;
		}
	});
{/if}
</script>
